package com.his.system.manager.task;

import com.alibaba.fastjson.JSONObject;

import java.util.Date;
import java.util.List;
import java.util.TimerTask;

/**
 * MyTaskRunnable
 *
 * @Description
 * @Author HHJ
 * @Date 2020-07-25 17:08
 */

public class MyTaskRunnable extends TimerTask {
    private JdbcUserDao userDao;
    private String name;

    MyTaskRunnable(String names, JdbcUserDao userDaos) {
        name = names;
        userDao = userDaos;
    }

    @Override
    public void run() {
        System.out.println("本次任务:" + name + "---执行开始");
        Date executeTime = new Date(this.scheduledExecutionTime());
        List<EntryRecord> userList = userDao.getEntryRecordList(0, 10);
        System.out.println("本次任务:" + name + "---执行结束:" + executeTime + "---测试:" + userList.size() + "-----结果:" + JSONObject.toJSONString(userList));

    }

}